package com.ccrfid.rmc6.repository.mattress;

import com.ccrfid.rmc6.entity.mattress.BedEntity;
import org.springframework.data.repository.Repository;

import java.util.List;

public interface BedRepository extends Repository<BedEntity, String> {

    List<BedEntity> getAllBy();

    Boolean existsByBedSn(String bedSn);

    Boolean existsByMattressSn(String mattressSn);

    Boolean existsByBedSnNotAndMattressSn(String bedSn, String mattressSn);

    List<BedEntity> getAllByMattressSnIsNotNull();

    BedEntity getByBedSn(String bedSn);

    BedEntity getByMattressSn(String mattressSn);

    BedEntity save(BedEntity entity);

    void deleteByBedSn(String bedSn);
}
